package common.statistics.jvm_info;


public class GarbageCollectorStatus
{

    public String name;
    //
    public long $collectionCount;
    public long totalCollectionCount = 0;

    public long minCollectionCount = -1;
    public long maxCollectionCount = -1;

    //
    public long $collectionTime;
    public long totalCollectionTime = 0;
    public long minCollectionTime = -1;
    public long maxCollectionTime = -1;

    public void setCollectionCount(long collectionCount)
    {
        this.$collectionCount = collectionCount - totalCollectionCount;
        this.totalCollectionCount = collectionCount;

        if (maxCollectionCount < this.$collectionCount)
        {
            maxCollectionCount = this.$collectionCount;
        }

        if (minCollectionCount == -1 || minCollectionCount > this.$collectionCount)
        {
            minCollectionCount = this.$collectionCount;
        }
    }

    public void setcollectionTime(long collectionTime)
    {
        this.$collectionTime = collectionTime - totalCollectionTime;
        this.totalCollectionTime = collectionTime;

        if (maxCollectionTime < this.$collectionTime)
        {
            maxCollectionTime = this.$collectionTime;
        }

        if (minCollectionTime == -1 || minCollectionTime > this.$collectionTime)
        {
            minCollectionTime = this.$collectionTime;
        }
    }
}
